import Utils from "../utils"

// type:页面类型 0:目录 1:页面 2:按钮
// is_menu:0:否 1:是
let nodeList = [
  {
    route_name: "",
    name: "权限管理",
    icon: "bi bi-person-lock",
    type: 0,
    is_menu: 1,
    create_at: "@datetime",
    children: [
      {
        route_name: "admin.user.index",
        name: "用户列表",
        icon: "",
        type: 1,
        is_menu: 1,
        create_at: "@datetime",
        children: [
          {
            route_name: "admin.user.create",
            name: "添加用户",
            icon: "",
            type: 1,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.store",
            name: "添加用户",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.role",
            name: "分配角色",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.edit",
            name: "编辑用户",
            icon: "",
            type: 1,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.update",
            name: "用户更新",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.edit",
            name: "查看用户",
            icon: "",
            type: 1,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.destroy",
            name: "用户删除",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.export",
            name: "用户导出",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.import",
            name: "用户导入",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.resetPwd",
            name: "重置密码",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.status",
            name: "用户状态",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
        ],
      },
      {
        route_name: "admin.role.index",
        name: "角色列表",
        icon: "",
        type: 1,
        is_menu: 1,
        create_at: "@datetime",
        children: [
          {
            route_name: "admin.role.create",
            name: "添加角色",
            icon: "",
            type: 1,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.role.store",
            name: "添加角色",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.role.node",
            name: "分配节点",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.role.edit",
            name: "编辑角色",
            icon: "",
            type: 1,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.role.update",
            name: "角色更新",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.user.destroy",
            name: "角色删除",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
        ],
      },
      {
        route_name: "admin.node.index",
        name: "节点列表",
        icon: "",
        type: 1,
        is_menu: 1,
        create_at: "@datetime",
        children: [
          {
            route_name: "admin.node.create",
            name: "添加节点",
            icon: "",
            type: 1,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.node.store",
            name: "添加节点",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
        ],
      },
    ],
  },
  {
    route_name: "",
    name: "文章管理",
    icon: "bi bi-book",
    type: 0,
    is_menu: 1,
    create_at: "@datetime",
    children: [
      {
        route_name: "admin.article.index",
        name: "文章列表",
        icon: "",
        type: 1,
        is_menu: 1,
        create_at: "@datetime",
        children: [
          {
            route_name: "admin.article.create",
            name: "添加文章",
            icon: "",
            type: 1,
            is_menu: 0,
            create_at: "@datetime",
          },
          {
            route_name: "admin.article.store",
            name: "添加文章",
            icon: "",
            type: 2,
            is_menu: 0,
            create_at: "@datetime",
          },
        ],
      },
    ],
  },
]

const flatNodes = []
Utils.convertToFlatNodes(nodeList, 1, 0, flatNodes)

export default flatNodes
